package tw.miku.protocol.codec.user;

import java.nio.charset.CharacterCodingException;

import org.apache.mina.core.buffer.IoBuffer;

import tw.miku.constants.ProtocalConstants;
import tw.miku.protocol.codec.AbstractResponseMessagePack;

public class UserExitRoomResponsePack extends AbstractResponseMessagePack
{
	public int userId;

	@Override
	public IoBuffer encode() throws CharacterCodingException
	{
		IoBuffer buf = IoBuffer.allocate(12);
		buf.putUnsignedInt(8);
		buf.putShort(ProtocalConstants.USER_EXIT_ROOM);
		buf.putShort((short) 0);
		buf.putUnsignedInt(userId);
		buf.flip();
		return buf;
	}

	@Override
	public short getTag()
	{
		return ProtocalConstants.USER_EXIT_ROOM;
	}
}
